package LinkedList;

import java.util.LinkedList;

/**
 * @author Administrator
 * @ClassName LinkedList
 * @TIME 星期二 2020/12/29
 */
class LinkedListTest {
    public static void main(String[] args) {
        LinkedList<String> link = new LinkedList<>();
        link.add("KED");
        link.addFirst("LIN");
        link.addLast("LIST");
        System.out.println("开头元素 " + link.getFirst());
        System.out.println("结尾元素 " + link.getLast());
        System.out.println("删除第一个元素 " + link.removeFirst());
        System.out.println("删除最后一个元素 " + link.removeLast());
        System.out.println(link);
    }
}
